package com.ruoyi.system.domain.dto;
import java.util.ArrayList;
import java.util.List;

public class CombinedTestData {
    private String testTime;
    private List<TestCorporeityDTO> corporeity = new ArrayList<>();
    private List<TestCorporeityDTO> corporeityRetest = new ArrayList<>();
    private TestTurgoscopeDTO turgoscope;
    private TestBodyfatDTO bodyfat;
    private TestPowerDTO power;
    private TestPowerHeartrateDTO powerHeartrate;

    private String idcard;

    public CombinedTestData(String testTime) {
        this.testTime = testTime;
    }

    public CombinedTestData(String testTime, String idcard) {
        this.testTime = testTime;
        this.idcard = idcard;
    }

    // 添加国民体质数据
    public void addCorporeity(TestCorporeityDTO dto) {
        this.corporeity.add(dto);
    }

    // Getters and Setters
    public String getTestTime() {
        return testTime;
    }

    public void setTestTime(String testTime) {
        this.testTime = testTime;
    }

    public List<TestCorporeityDTO> getCorporeity() {
        return corporeity;
    }

    public void setCorporeity(List<TestCorporeityDTO> corporeity) {
        this.corporeity = corporeity;
    }

    public List<TestCorporeityDTO> getCorporeityRetest() {
        return corporeityRetest;
    }

    public void setCorporeityRetest(List<TestCorporeityDTO> corporeityRetest) {
        this.corporeityRetest = corporeityRetest;
    }

    public TestTurgoscopeDTO getTurgoscope() {
        return turgoscope;
    }

    public void setTurgoscope(TestTurgoscopeDTO turgoscope) {
        this.turgoscope = turgoscope;
    }

    public TestBodyfatDTO getBodyfat() {
        return bodyfat;
    }

    public void setBodyfat(TestBodyfatDTO bodyfat) {
        this.bodyfat = bodyfat;
    }

    public TestPowerDTO getPower() {
        return power;
    }

    public void setPower(TestPowerDTO power) {
        this.power = power;
    }

    public TestPowerHeartrateDTO getPowerHeartrate() {
        return powerHeartrate;
    }

    public void setPowerHeartrate(TestPowerHeartrateDTO powerHeartrate) {
        this.powerHeartrate = powerHeartrate;
    }

    // 检查是否包含所有类型的数据（国民体质至少有一个）
    public boolean isComplete() {
        return !corporeity.isEmpty() &&
                turgoscope != null &&
                bodyfat != null &&
                power != null &&
                powerHeartrate != null;
    }

    @Override
    public String toString() {
        return "CombinedTestData{" +
                "testTime='" + testTime + '\'' +
                ", corporeityCount=" + corporeity.size() +
                ", turgoscope=" + (turgoscope != null) +
                ", bodyfat=" + (bodyfat != null) +
                ", power=" + (power != null) +
                ", powerHeartrate=" + (powerHeartrate != null) +
                '}';
    }

    public String getIdcard() {
        return idcard;
    }

    public void setIdcard(String idcard) {
        this.idcard = idcard;
    }
}